package com.tfswue.mxj.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

@Component  //将类交给spring管理
//主要作用是将配置文件中的属性值注入到该类中，参数是prefix指的是前缀，父类
@ConfigurationProperties(prefix = "user")

@Data
//@NoArgsConstructor 自动生成无参构造
//@AllArgsConstructor 自动生成全参构造
public class User {
    private Integer id;

    private String username;

    protected ArrayList<String> address;

    private ArrayList<Grade> grades;
}

@Data
class Grade {
    private String subject;
    private String score;
}
